<template>
  <div id="box">
    <van-nav-bar
      title="详情"
      left-text="返回"
      left-arrow
      right-text="举报"
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <Dongtai :dynamicRecord="this.$route.params.detail"></Dongtai>
  </div>
</template>

<script>
import Dongtai from "./dongtai";
export default {
  mounted() {
    if(!this.$route.params.detail) this.$router.go(-1);
    let detail = this.$route.params.detail;
    this.$axios
      .get(
        `${this.$api}getdynamicRecord/skimadd/${detail.useID}/${detail.dataTime}`
      )
      .then((res) => {
        console.log(res);
      });
  },
  data() {
    return {

    };
  },
  components: {
    Dongtai,
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      console.log(this.$route.params.detail);
      let detail = this.$route.params.detail;
      this.$axios
        .get(
          `${this.$api}complaints/${detail.useID}/${detail.dataTime}/${this.$store.state.weight}/${this.$store.state.userId}`
        )
        .then((res) => {
          console.log(res);
          this.$toast.fail(res.data);
        });
    },
  },
};
</script>

<style>
</style>